SET "NuGetVersion=%1"
IF "%2" == "" GOTO :notPreRelease
SET "NuGetVersion=%1-%2"

:notPreRelease
ECHO NuGetVersion is %NuGetVersion%

pushd ..\releases\v%1\source

rem Periscope Main
del _nuspec\Periscope\tools\delete.me
del _nuspec\Periscope\lib\net45\delete.me
del _nuspec\Periscope\content\scripts\delete.me
copy Wolfpack.Periscope.Hosts\bin\debug\*.* _nuspec\Periscope\lib\net45
del _nuspec\Periscope\lib\net45\*.xml
del _nuspec\Periscope\lib\net45\*.pdb
rem move _nuspec\Periscope\lib\net45\Wolfpack.Periscope.Hosts.exe.config _nuspec\Periscope\content
xcopy Wolfpack.Periscope.Hosts\bin\debug\content\*.* _nuspec\Periscope\content\content /Y /R /I /E
xcopy Wolfpack.Periscope.Hosts\bin\debug\scripts\*.* _nuspec\Periscope\content\scripts /Y /R /I /E
xcopy Wolfpack.Periscope.Hosts\bin\debug\views\*.* _nuspec\Periscope\content\views /Y /R /I /E
xcopy Wolfpack.Periscope.Hosts\bin\debug\widgets\*.* _nuspec\Periscope\content\widgets /Y /R /I /E

popd
pushd ..\
Automation\NuGet\NuGet.exe pack Releases\v%1\source\_nuspec\Periscope\Periscope.nuspec -version %NuGetVersion% -OutputDirectory Releases\v%1
popd

